<?php
/*
* Kusht Mud.
* ----
* The MIT License
* Copyright (c) 2010 Andrew Tutt
* ----
*/

/* Basic Connector Class
*
* Should only hold connection-related information regarding a connected user
*/

class BasicConnector {
	public $id; 		/* This is a Connection ID, not a Game Object ID */
	public $socket; 	/* This is the User's Socket */
	public $handshake;  /* This is the User's Handshake */
	public $server;		/* The Server Object in which the user is embedded */
	public $user;		/* This is the user who owns this connection */
	public $loggedin;   /* Is the Connector In the Stream or Entering It? */
	// I.E. Is this person on their own thread or in the main thread?
		
	function send($msg) {
	  ioHandler::inputecho("> ".$msg);
	  $msg = ioHandler::wrap($msg);
	  if (socket_write($this->socket,$msg,strlen($msg))===FALSE) {
	  	ioHandler::unexpectedDisconnect($this);
	  }
	}
}

?>